package elephant.application;

import elephant.Container;
import elephant.jdbc.datasource.DruidDataSource;
import elephant.servers.rpcserver.RPCServer;
import elephant.service.db.JdbcService;

/**
 * 
 * @author skydu
 *
 */
public class DemoApplication {

	public static void main(String[] args) throws Exception {
		Container container = Container.get();
		DruidDataSource dataSource = new DruidDataSource();
		dataSource.setJdbcUrl("jdbc:mysql://skydu.cn:8001/db_skydu");
		dataSource.setUsername("root");
		dataSource.setPassword("sky2016!#");
		dataSource.setDriverClassName("com.mysql.jdbc.Driver");
		//
		JdbcService jdbcService = new JdbcService();
		jdbcService.addDataSource(dataSource);
		container.registerService(jdbcService);
		//
		RPCServer rpcServer = new RPCServer();
		rpcServer.setPort(5001);
		container.registerServer(rpcServer);
		//
		container.loadApplication("/tmp/SkyduBizSystem-1.0.0.zip");
		//
		container.init();
		container.start();

	}
}
